package com.ss.demo.springbootdemo.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * 作者: MrZhangJR
 * 时间: 2021/11/3 11:24
 * 描述:
 */
@Aspect
@Component
public class OrderAspect {

    @Before("execution (* *..controller.Order*.*(..))")
    public void orderBefore(JoinPoint jp) {
        Object[] args = jp.getArgs();
        System.out.println("orderBefore参数: " + Arrays.toString(args));
        System.out.println("权限校验开始....");
    }

    @After("execution (* *..controller.Order*.*(..))")
    public void orderAfter(JoinPoint jp) {
        Object[] args = jp.getArgs();
        System.out.println("orderBefore参数: " + Arrays.toString(args));
        System.out.println("日志记录开始....");
    }

}
